<?php
require ('../include/init.inc.php');
extract ( $_REQUEST );


$module = Card::getById ( $id );
if(empty($module)){
	Common::exitWithError(ErrorMessage::MODULE_NOT_EXIST,"panel/modules.php");
}

if (Common::isPost ()) {

	Card::deleteCardOpen($id,$module["open_time"]);
	$phone_id = Card::findPhone($open_time,$card["type"]);
		$list = Card::reopen($module["id"], $module["card_type"],$open_time,$phone_id);
		
		if ($list) {
			SysLog::addLog ( UserSession::getUserName(), 'MODIFY', 'Module' ,$module_id, json_encode($update_data) );
			Common::exitWithSuccess ('更新完成','panel/sms.php');
		} else {
			OSAdmin::alert("error");
		}
	
}

$module["open_time"] = substr($module["open_time"], 0,10);
Template::assign ( 'module', $module );
Template::assign ( 'view', $view );
Template::display ( 'panel/sms_view.tpl' );